from selenium import webdriver
from time import sleep
MyLoginURL = 'https://200.200.156.248/WLAN/index.php'
MyWeb = webdriver.Chrome()

MyWeb.get(MyLoginURL)
sleep(1)
if MyWeb.find_element_by_id("primary-button"):
    MyWeb.find_element_by_xpath("//*[@id='details-button']").click()
    sleep(1)
    MyWeb.find_element_by_xpath("//*[@id='proceed-link']").click()
    sleep(1)
MyWeb.find_element_by_xpath("//*[@id='login_user']").send_keys('admin')
MyWeb.find_element_by_xpath("//*[@id='login_password']").send_keys('Qwer1234')
if MyWeb.find_element_by_name("checkProtocol").is_selected():
    MyWeb.find_element_by_xpath("//*[@id='sub']").click()
else:
    MyWeb.find_element_by_name("checkProtocol").click()
    MyWeb.find_element_by_xpath("//*[@id='sub']").click()
sleep(60)